#!/usr/bin/python

# This is statement is required by the build system to query build info
if __name__ == '__build__':
	raise Exception


import sys
from OpenGL.GL import *
from OpenGL.GLE import *
from OpenGL.GLUT import *


def JoinStyle (msg):
	sys.exit(0)




def main(DrawStuff, Idle):
	global glutDisplayFunc, glutMotionFunc
	# initialize glut 
	glutInit(sys.argv)
	glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)
	glutInitWindowSize( 500, 500 )
	glutCreateWindow("basic demo")
	glutDisplayFunc(DrawStuff)
	glutIdleFunc(Idle)
	# create popup menu */
	glutCreateMenu (JoinStyle)
	glutAddMenuEntry ("Exit", 99)
	glutAttachMenu (GLUT_RIGHT_BUTTON)

	# initialize GL */
	glClearDepth (1.0)
	glEnable (GL_DEPTH_TEST)
	glClearColor (0.0, 0.0, 0.0, 0.0)
	glShadeModel (GL_SMOOTH)

	glMatrixMode (GL_PROJECTION)
	# roughly, measured in centimeters */
	glFrustum (-9.0, 9.0, -9.0, 9.0, 50.0, 150.0)
	glMatrixMode(GL_MODELVIEW)

	glutMainLoop ()

	
